﻿using System;
using System.Collections.Generic;
using System.Linq;
using LBoL.Base;
using LBoL.ConfigData;
using LBoL.Core;
using LBoL.Core.Battle;
using LBoL.Core.Battle.BattleActions;
using LBoL.Core.Battle.Interactions;
using LBoL.Core.Cards;
using LBoLEntitySideloader.Attributes;
using ProbeMod.Cards.Template;

namespace ProbeMod.Cards
{
    public sealed class ProbeRicochetGlaiveDef : ProbeCardTemplate
    {
        public override CardConfig MakeConfig()
        {
            var config = GetCardDefaultConfig();

            config.Rarity = Rarity.Common;
            config.Type = CardType.Attack;
            config.TargetType = TargetType.SingleEnemy;
            config.Colors = new List<ManaColor>() { ManaColor.White };

            config.Cost = new ManaGroup() { Any = 0 };
            config.UpgradedCost = new ManaGroup() { Any = 0 };

            config.Damage = 5;
            config.UpgradedDamage = 8;
            
            config.Keywords = Keyword.Echo;
            config.UpgradedKeywords = Keyword.Echo;

            config.Index = CardIndexGenerator.GetUniqueIndex(config);
            return config;
        }
    }

    /// <summary>
    /// 回旋刃
    /// </summary>
    [EntityLogic(typeof(ProbeRicochetGlaiveDef))]
    public sealed class ProbeRicochetGlaive : ProbeCard
    {
        protected override IEnumerable<BattleAction> Actions(UnitSelector selector, ManaGroup consumingMana, Interaction precondition)
        {
            yield return AttackAction(selector);
            
        }
    }
}
